package com.company.behavioral.visitor_pattern.concrete_element;

import com.company.behavioral.visitor_pattern.element.Employee;
import com.company.behavioral.visitor_pattern.visitor.Department;

/**
 * 兼职员工类
 * @ClassName ParttimeEmployee
 * @Author tiezheng.han
 * @Date 2020/9/7 16:36
 **/
public class ParttimeEmployee implements Employee {

    /**
     * 员工姓名
     */
    private String name;

    /**
     * 员工时薪
     */
    private double hourWage;

    /**
     * 工作时间
     */
    private int workTime;

    public ParttimeEmployee(String name, double hourWage, int workTime) {
        this.name = name;
        this.hourWage = hourWage;
        this.workTime = workTime;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public double getHourWage() {
        return hourWage;
    }

    public void setHourWage(double hourWage) {
        this.hourWage = hourWage;
    }

    public int getWorkTime() {
        return workTime;
    }

    public void setWorkTime(int workTime) {
        this.workTime = workTime;
    }

    @Override
    public void accept(Department handler) {
        // 调用访问者的访问方法
        handler.visit(this);
    }
}
